import app from '../app';
export function GET(url, data = null) {
    return new Promise((resolve, reject) => {
        const options = {
            url: url.indexOf('https:') > -1 ? url : app.globalData.config.server + url,
            method: 'GET',
            header: wx.getStorageSync('cookie'),
            data,
            success: function (res) {
                res.data && resolve(res.data);
            },
            fail: function (err) {
                reject(err);
            }
        }
        !data && delete options.data;
        wx.request(options);
    });
}